
<!-- ========================================== top ========================================== -->
 <link rel="stylesheet" href="${cxt!}/css/css/reset.css"/>
 <link rel="stylesheet" href="${cxt!}/css/project/project.css"/>
<!-- ========================================== top ========================================== -->

 
<!-- ======================================== content ======================================== -->
        
     <form action="${cxt!}/admin/project/addProject" method="post"  id="addProject" enctype="multipart/form-data" >
        <div class="right_cont row  border-bottom white-bg">
            <!--列表二-->
            <div class="list_two kaifa_step1">
                <div class="list_t up_none kai_border"><em>${_res["project.projectTitle"]}</em></div>
                <!-- =========================================================== 第一步 开始 ================================================== -->
                <div class="kai_sc">
                    <div class="kai_sct">
                        <img src="${cxt!}/img/images/shu.jpg" alt="${_res['project.imgAlt']}">
                        <p class="hover">${_res["project.basic"]}</p>
                        <p>${_res["project.sale"]}</p>
                        <p>${_res["project.document"]}</p>
                    </div> 
                    
	                    <div class="overE">
	                        <!--内容块1 新增楼盘-->
	                        <div class="kai_ss">
	                            <div class="kai_s" style="height: 55px;overflow: visible;">
	                                <div class="floatE">
	                                	<%if(!isEmpty(project!)){%>
	                                	<input type="hidden" name="project.id" value="${project.id!}">
	                                	
	                                	<input type="hidden" name="projectDetail.id" value="${project.projectDetail.id!}">
	                                	
	                                	<%}%>
	                                    <!-- 项目名称 -->
	                                    <label><span>*</span>${_res["project.projectName"]}:</label>
	                                    <input type="text" class="page1" id="projectname" name="project.projectname" value="${project.projectname!}" data-rule-required="true" data-msg-required=" " maxlength="80"/>
	                                </div>
	                                <div class="floatE" style="overflow: visible;">
	                                    <!-- 房屋类型 -->
	                                    <label><span>*</span>${_res["project.projectType"]}:</label>
	                                    <#dict class="kai_se r" type="select" name="project.projecttype" dictCode="PROJECT_TYPE" value="${project.projecttype!}" empty="false" />
	                                </div>
	                            </div>
	
	                            <div class="kai_s">
	                                <div class="floatE">
	                                    <!-- 项目座标 -->
	                                    <label>${_res["project.coordinates"]}:</label>
	                                    <div class="kai_sco" style="margin-right: 8px;">
	                                        <label style="margin-top: 0px;">${_res["project.longitude"]}</label>
	                                        <input type="text" id="longitude"  onkeypress="return keyPressCoordinates(event);" style="ime-mode:disabled"  name="project.longitude" value="${project.longitude!}" data-rule-number="true" maxlength="80" />
	                                        <small>o</small>
	                                    </div>
	                                    <div class="kai_sco" style="margin-right: 0px\9;margin-left: -27px;">
	                                        <label style="margin-top: 0px;">${_res["project.latitude"]}</label>
	                                        <input type="text" id="latitude" onkeypress="return keyPressCoordinates(event);" style="ime-mode:disabled" name="project.latitude" value="${project.latitude!}" data-rule-number="true"  maxlength="80" />
	                                        <small>o</small>
	                                    </div>
	                                </div>
	                                <div class="floatE">
	                                    <!-- 开发商 -->
	                                    <label><span>*</span>${_res["project.developer"]}:</label>
	                                    <input type="hidden" id="customerDeveloper" name="project.developer" value="${project.developerId!}"> 
	                                     <input type="text" id="developer" name="developerName" readonly class="dev_d btn" href="#dev_developer" data-toggle="modal" value="${project.developer!}" data-rule-required="true" data-msg-required=" " style="width:349px;text-align: left;"/>
	                                </div>
	                            </div>
	                            
	                            <!-- 开发商角色选择弹框 -->
                            <div id="dev_developer" class="modal animated" data-easein="fadeInDown" data-easeout="fadeOutDown">
                                <div class="developer" style="position: relative;z-index: 100;">
                                    <div class="tips developer_c">
                                        <a href="javascript:;" class="log_close czlyb_z_close" data-dismiss="modal" aria-hidden="true"></a>
                                        <em>${_res["project.developerTip"]}</em>
                                        <div class="tips_k">
                                            <div class="tips_c">
                                            	<%for(var i=0;i<developer.~size;i++){%>
                                                <div class="overE"><input type="radio" name="developer" value="${developer[i].companyname!}" title="${developer[i].id!}" onclick="selectDeveloper(this);"/><span id="role${i}">${developer[i].companyname!}</span></div>
                                                <%}%>
                                            </div>
                                        </div>
                                        <a href="javascript:;"  class="tips_a floatR down_css dev_q" data-dismiss="modal" aria-hidden="true">${_res["project.confirm"]}</a>
                                    </div>
                                </div>
                            </div>
                            <!-- 开发商角色选择弹框 -->
	                            <div class="kai_s">
	                                <div class="floatE">
	                                    <!-- 建筑商 -->
	                                    <label>${_res["project.builder"]}:</label>
	                                    <input type="text" name="project.builder" value="${project.builder!}" maxlength="80"/>
	                                </div>
	                                <div class="floatE">
	                                    <!-- 建筑设计公司 -->
	                                    <label><span>*</span>${_res["project.architecture"]}:</label>
	                                    <input type="text"  class="page1" name="project.architecture" value="${project.architecture!}"  maxlength="80" data-rule-required="true" data-msg-required=" "/>
	                                </div>
	                            </div>
	
	
	                            <div class="kai_s">
	                                <div class="floatE">
	                                    <!-- 室内设计公司 -->
	                                    <label>${_res["project.InteriorDesigner"]}:</label>
	                                    <input type="text" name="project.interiordesigner" value="${project.interiordesigner!}" maxlength="80"/>
	                                </div>
	                            </div>
	                            
	                            <div class="kai_s">
	                                
	                                <div class="floatE">
	                                    <!-- DA审批 -->
	                                    <label><span>*</span>${_res["project.DAApproval"]}:</label>
	                                    <#dict type="select"  class="kai_se r" id="da" name="project.daapproval" dictCode="DA_APPROVAL_STATUS" empty="false" value="${project.daapproval!}"/>
	                                </div>
	                                
	                                <div class="floatE" style="white-space: inherit;margin-right: 22px;">
	                                    <!-- DA日期-->
	                                    <label><span></span>${_res["project.DADate"]}:</label>
		                                <input type="text" id="dadate" class="form-control layer-date laydate-icon" style="max-width:347px;" onclick="laydate()" name="project.dadate" value="${project.dadate!,dateFormat='yyyy-MM-dd'}">
	                                </div>
	                                
	                            </div>
	
	                            <div class="kai_s">
	                                <div class="floatE" style="white-space: inherit;margin-right: 22px;">
	                                    <!-- 预计开工时间 -->
	                                    <label class="gu_li"><span>*</span>${_res["project.constructionCommence"]}:</label>
		                                <input type="text" id="constructioncommerce" class="form-control layer-date laydate-icon" data-rule-required="true" data-msg-required=" " style="max-width:347px;" onclick="laydate()" name="project.constructioncommence" value="${project.constructioncommence!,dateFormat='yyyy-MM-dd'}" data-rule-required="true" data-msg-required=" ">
	                                </div>
	                                <div class="floatE">
	                                    <!-- 预计交房时间 -->
	                                    <label style="margin-left: 4px;"><span>*</span>${_res["project.settlement"]}:</label>
	                                    <input type="text"  data-rule-comparedate="#constructioncommerce" data-msg-comparedate=" "  class="form-control layer-date laydate-icon" data-rule-required="true" data-msg-required=" " style="max-width:347px;margin-left: 1px;" onclick="laydate()"  name="project.estsettlement" value="${project.estsettlement!,dateFormat='yyyy-MM-dd'}"/>
	                                </div>
	                            </div>
	
	                            <div class="kai_s">
	                                 <div class="floatE">
	                                    <!-- 套数 -->
	                                    <label><span>*</span>${_res["project.TotalLots"]}:</label>
	                                    <input type="text" class="page1" id="totalapartment" onkeypress="return keyPress(event);" style="ime-mode:disabled" name="project.totalapartments" value="${project.totalapartments!}"  data-rule-required="true" data-msg-required=" "  data-rule-number="true" maxlength="4" />
	                                </div>
	                                <div class="floatE">
	                                    <!-- 层数 -->
	                                    <label><span>*</span>${_res["project.TotalLevel"]}:</label>
	                                    <input type="text" class="page1" id="totallevel" data-msg-required=" " onkeypress="return keyPress(event);" style="ime-mode:disabled" name="project.totallevel" value="${project.totallevel!}"  data-rule-required="true" data-rule-number="true" maxlength="4" />
	                                </div>
	                            </div>
	
	                            <div class="kai_s">	                               
	                                <div class="floatE">
	                                    <!-- 在售套数 -->
	                                    <label><span>*</span>${_res["project.available"]}:</label>
	                                    <input type="text" class="page1" id="available" data-msg-required=" " onkeypress="return keyPress(event);" style="ime-mode:disabled" name="project.available" value="${project.available!}"  data-rule-required="true" data-rule-number="true" maxlength="4" />
	                                </div>
	                                <div class="floatE">
	                                    <!-- 卖出套数 -->
	                                    <label><span>*</span>${_res["project.sold"]}:</label>
	                                    <input type="text" class="page1" id="sold" data-msg-required=" " onkeypress="return keyPress(event);" style="ime-mode:disabled" name="project.sold" value="${project.sold!}"  data-rule-required="true" data-rule-number="true" maxlength="4" />
	                                </div>
	                            </div>
	
	                            <div class="kai_s null_q">
	                                <!-- 项目地址 -->
	                                <label><span>*</span>${_res["project.ProjectAddress"]}:</label>
	                                <div class="floatE">
	                                    <!-- 地址 -->
	                                    <input type="text" class="page1" data-msg-required=" " id="address" class="kai_si" placeholder="${_res['project.AddressLine']}" name="project.addressline1" value="${project.addressline1!}" data-rule-required="true"  maxlength="80"/>
	                                </div>
	                                <div class="floatE">
	                                    <!--City/Town-->
	                                    <input type="text" class="page1" id="city" data-msg-required=" " class="kai_si" placeholder="${_res['project.city']}" name="project.city" style="width:180px;" value="${project.city!}" data-rule-required="true" maxlength="40"/>
	                                </div>
	                                <div class="floatE">
	                                    <!--State/Province-->
	                                    <input type="text" class="page1" id="state" data-msg-required=" " class="kai_si" placeholder="${_res['project.state']}" name="project.state" style="width:148px;" value="${project.state!}" data-rule-required="true" maxlength="80"/>
	                                </div>
	                                <div class="floatE">
	                                    <!-- Country -->
	                                    <div class="sign_two_ss">
	                                        <input type="text" data-msg-required=" " class="sign_two_sz sign_two_sz1" style="width:203px;" id="countryName"  value="${project.country!}"  readonly="readonly" data-rule-required="true" onclick="countrySelect(this);" data-rule-required="true" data-msg-required=" "/>
                                			<div class="sign_two_sq sign_two_sq1" id="countryNameDiv" >
                                    			<input type="text"  name="searchCountry" id="searchCountry"/>
                                    			<input type="hidden" name="project.country" value="${project.countryId!}" id="country" />
                                    			<ul class="sign_two_su" id="countryUl">
                                   					<%
													#ajax selectCountryAjax: {
													%>
                                        			<%for(country in countrys!){%>
                                        			<input type="hidden" name="country" value="${country.name!}" />
                                        			<li value="${country.id!}" onclick="clickCountryUI(this);">${country.name!}</li>
                                        			<%}%>
                                    				<%
													}
									 	 			%>
                                    			</ul>
                                			</div>
	                                    </div>
	                                </div>
	                            </div>
	                            <div class="kai_s">
	                                <!-- 邮政编码 -->
	                                <label><span>*</span>${_res["project.ZipCode"]}:</label>
	                                <input type="text" class="page1" class="kai_si" data-msg-required=" "  id="postcode" name="project.postcode"  value="${project.postcode!}"  data-rule-required="true"  maxlength="6" />
	                            </div>
	                            <div class="kai_s kai_sad kai_sad1">
	                                <!-- 配套设施 -->
	                                <label><span>*</span>${_res["project.facilities"]}:</label>
	                                <%if(!isEmpty(project.projectItems['facilities']!)){%>
	                                <input type="text" id="facilities" data-msg-required=" " class="kai_swm" name="facilitieskey1value1.itemValue" value="${project.projectItems['facilities'][0].itemValue!}" data-rule-required="true" maxlength="80">
	                                <%var facilities = project.projectItems['facilities'];
	                                	if(facilities.~size>=2){
	                                	for(var i = 1;i<facilities.~size;i++){%>
	                                <div class="overE clear">
	                                	<input type="text" data-msg-required=" " class="kai_swm kai_swm1" name="facilitieskey${i+1}value${i+1}.itemValue" value="${facilities[i].itemValue!}"  data-rule-required="true" maxlength="80">
	                                	<a href="javascript:;" class="faq_ia3">${_res["project.delete"]}</a>
	                                </div>
	                                <%}}}else{%>
	                                <input type="text" id="facilities"  data-msg-required=" " class="page1 kai_swm" name="facilitieskey1value1.itemValue"  data-rule-required="true" maxlength="80">
	                                <%}%>
	                            </div>
	                            <!-- 增加、移除多行 -->
	                            <a href="javascript:;" class="faq_ia faq_ia1 floatE">${_res["project.add"]}</a>
	                            <!-- 增加、移除多行 -->
	                            <div class="clear"></div>
								<!-- faq -->
	                            <div class="kai_s faq_ip">
	                                <label>${_res["project.FAQ"]}:</label>
	                                <%if(!isEmpty(project.projectItems['faq']!)){%>
	                                <input type="text" data-msg-required=" " name="faqvalue1.itemName" placeholder="${_res['project.Q']}:"  maxlength="80" value="${project.projectItems['faq'][0].itemname}">
	                                <textarea class="faq_tea" name="faqvalue1.itemValue" placeholder="${_res['project.A']}:" maxlength="120">${project.projectItems['faq'][0].itemvalue!}</textarea>
									<%var faq = project.projectItems['faq'];
										if(!isEmpty(faq)){
	                                	if(faq.~size>=2){
	                                	for(var i = 1;i<faq.~size;i++){%>
	                                	<div class="cyx_faq_add">
	                                		<input type="text" data-msg-required=" " style="width: 816px;margin-bottom: 15px;" name="faqvalue${i+1}.itemName" class="faq_ipp kai_swm1" placeholder="${_res['project.Q']}:"  value="${faq[i].itemname!}" maxlength="80">
	                                		<textarea style="padding-left: 10px;" class="faq_tea kai_swm1 floatE" name="faqvalue${i+1}.itemValue" maxlength="128" placeholder="${_res['project.A']}:">${faq[i].itemvalue!}</textarea>
	                                		<a href="javascript:;" class="faq_ia3" style="padding: 0;margin-top: -55px;margin-left: -120px;">delete</a>
	                                	</div>
	                                <%}}}}else{%>
	                                <input type="text" name="faqvalue1.itemName" placeholder="${_res['project.Q']}:" maxlength="80">
	                                <textarea class="faq_tea" name="faqvalue1.itemValue" placeholder='${_res["project.A"]}:' maxlength="120"></textarea>
	                                <%}%>
	                            </div>
	                            <a href="javascript:;" class="faq_ia cyx_faq_ia" onclick="addFaq();">${_res["project.add"]}</a>
	                            <!-- 项目介绍 -->
	                            <div class="kai_s">
	                                <label><span>*</span>${_res["project.ProjectIntroduction"]}:</label>
	                                <textarea id="introduction" data-msg-required=" " class="page1" name="project.introduction"  data-rule-required="true" maxlength="1024">${project.introduction!}</textarea>
	                            </div>
	                            <!-- 项目所在区域介绍 -->
	                            <div class="kai_s">
	                                <label><span>*</span>${_res["project.SuburbIntroduction"]}:</label>
	                                <textarea data-msg-required=" " name="project.suburbintroduction" class="page1" id="suburbintroduction"  data-rule-required="true" maxlength="1024">${project.suburbintroduction!}</textarea>
	                            </div>
	                            <!-- 项目周边配套 -->
	                            <div class="kai_s">
	                                <label><span>*</span>${_res["project.LocalAmenity"]}:</label>
	                                <textarea data-msg-required=" " name="project.localamenity" class="page1" id="localamenity"  data-rule-required="true" maxlength="1024">${project.localamenity!}</textarea>
	                            </div>
	                            <!-- 设计理念 -->
	                            <div class="kai_s">
	                                <label>${_res["project.DesignVision"]}:</label>
	                                <textarea name="project.designvision"  maxlength="1024">${project.designvision!}</textarea>
	                            </div>
	                            <!-- 项目官方页面 -->
	                            <div class="kai_s">
	                                <div class="floatE">
	                                	<label>${_res["project.ProjectWebSite"]}:</label>
	                                	<input type="text" name="project.officialwebsite" value="${project.officialwebsite!}"  maxlength="80">
	                                </div>
	                                <div class="floatE">
	                                	<!-- 车位价格 -->
	                                    <label>${_res["project.CarparkPrice"]}:</label>
	                                    <input type="text" name="project.carparkprice" id="carparkprice" onkeypress="return keyPress(event);"  value="${project.carparkprice!}" maxlength="9" />
	                                </div> 
	                            </div>
	
	                            <!-- 典型户型 -->
	                            <div class="kai_video" >
	                                <div class="kai_s floatE">
	                                    <label style="width: 197px;text-align:right;margin-top: 10px;margin-left: -8px;"><span>*</span>${_res["project.TypicalApartmentLayout"]}:</label>
	                                </div>
	                                <div class="floatE kai_suq" id="typicalhouseDivID">
	                                    <%#ajax ajaxprojectTypicalhouse:{%>
	                                    <%if(!isEmpty(project.projectTypicalhouses!)){
	                                    	var projectTypicalhouses = project.projectTypicalhouses;
	                                    	for(var i = 0;i<projectTypicalhouses.~size;i++){
	                                    	
	                                    %>
	                                    <div class="kai_sqq" id="projectTypicalhouse${index!}">
	                                        <div class="kai_s faq_sel" style="margin-left: 1px;">
	                                        	<#dict type="select" name="projectTypicalhouse_${i!}.square" class="bed"  dictCode="TYPICALHOUSE" empty="false" value="${projectTypicalhouses[i].square!}"/>
	                                            <!-- 套数 -->
	                                            <label style="margin-top: 4px;">No.</label>
	                                            <input type="text" data-msg-required=" " class="page1 kai_siq" id="totalno" onkeypress="return keyPress(event);" style="ime-mode:disabled" data-rule-required="true" data-rule-number="true"  maxlength="9" name="projectTypicalhouse_${i!}.totalno"  value="${projectTypicalhouses[i].totalno!}" />
	                                            <!-- 价格 -->
	                                            <div class="overE">
	                                                <label style="margin-top: 5px;">${_res["project.PriceStartingFrom"]}:</label>
	                                                <input type="text" data-msg-required=" " class="page1 kai_sv r" id="amount" onkeypress="return keyPress(event);" style="ime-mode:disabled" data-rule-required="true" data-rule-number="true"  maxlength="9" name="projectTypicalhouse_${i!}.amount"  value="${projectTypicalhouses[i].amount!}" >
	                                                <em>${_res["project.aud"]}</em>
	                                            </div>
	                                        </div>
	                                        <!-- 户型图 -->
	                                        <div class="faq_j">
		                                        <input type="file" style="opacity: 0;filter:alpha(opacity=0);-moz-opacity:0;-khtml-opacity: 0; " id="fileuploadfile${i!}" name="contenurl" onchange="fileUpload1(this,'uploadfiles${i!}','${i!}');"/>
	                                            <a href="javascript:;" class="faq_jia" id="uploadfile${i!}" onclick="uploadImge(this);"></a>
	                                            <div class="faq_ji">
	                                                <div class="overE">
	                                                    <div id="uploadfiles${i!}">
	                                                    	<%#ajax ajaxuploadfile1:{
		                                                		if(!isEmpty(uploadFile!)){
		                                                	%>
		                                                	<input type="hidden" name="projectTypicalhouse_${index!}_${houseIndex!}.photo" value="${uploadFile.path!}">
		                                                	<%if(!isEmpty(uploadFile.path!)){%>
		                                                    <img src="${imgCxt!}/${uploadFile.path!}" alt="" width="125" height="125">
		                                                	<%}}else{
		                                                	  var photo = projectTypicalhouses[i].photos;
		                                                	  for(var j = 0;j<photo.~size;j++){%>
		                                                	<input type="hidden" name="projectTypicalhouse_${i!}_${j!}.photo" value="${photo[j]!}">
		                                                	<%if(!isEmpty(photo[j]!)){%>
		                                                    <img src="${imgCxt!}/${photo[j]!}" alt="" width="125" height="125">
		                                                	<%}}%>
		                                                	<%}}%>
		                                                </div>
	                                                    <span class="faq_ja_n">${_res["project.ApartmentLayout"]}</span>
	                                                    <a href="javascript:;" class="faq_ja faq_ja_m" onclick="deleteHouse(this);">${_res["project.delete"]}</a>
	                                                </div>
	                                            </div>
	                                        </div>
		                                 </div>
		                                 <%}}else{%>
		                                 <div class="kai_sqq" id="projectTypicalhouse${index!}">
	                                        <div class="kai_s faq_sel">
	                                        	<%if(isEmpty(index)){%>
	                                        	<#dict type="select" name="projectTypicalhouse_0.square" class="bed"  dictCode="TYPICALHOUSE" empty="false" value="${project.projectTypicalhouses[0].square!}"/>
	                                            <!-- 套数 -->
	                                            <label style="margin-top: 4px;">No.</label>
	                                            <input type="text" data-msg-required=" " class="page1 kai_siq" id="totalno" onkeypress="return keyPress(event);" style="ime-mode:disabled" data-rule-required="true" data-rule-number="true"  maxlength="9" name="projectTypicalhouse_0.totalno"  value="${project.projectTypicalhouses[0].totalno!}" />
	                                            <!-- 价格 -->
	                                            <div class="overE">
	                                                <label style="margin-top: 5px;">${_res["project.PriceStartingFrom"]}:</label>
	                                                <input type="text" data-msg-required=" " class="page1 kai_sv r" id="amount" onkeypress="return keyPress(event);" style="ime-mode:disabled" data-rule-required="true" data-rule-number="true"  maxlength="9" name="projectTypicalhouse_0.amount"  value="${project.projectTypicalhouses[0].amount!}" >
	                                                <em>${_res["project.aud"]}</em>
	                                            </div>
	                                            <%}else{%>
	                                        	<#dict type="select" name="projectTypicalhouse_${index!}.square" class="bed"  dictCode="TYPICALHOUSE" empty="false" value="${project.projectTypicalhouses[0].square!}"/>
	                                            <!-- 套数 -->
	                                            <label style="margin-top: 4px;">No.</label>
	                                            <input type="text" data-msg-required=" " class="page1 kai_siq" id="totalno" onkeypress="return keyPress(event);" onkeyup="value=value.replace(/[^\d]/g,'')" value="" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))" onblur="var qq=$(this).val();if(qq=='') return false;" style="ime-mode:disabled" data-rule-required="true" data-rule-number="true"  maxlength="9" name="projectTypicalhouse_${index!}.totalno"  value="${project.projectTypicalhouses[0].totalno!}" />
	                                            <!-- 价格 -->
	                                            <div class="overE">
	                                                <label style="margin-top: 5px;">${_res["project.PriceStartingFrom"]}:</label>
	                                                <input type="text" data-msg-required=" " class="page1 kai_sv r" id="amount" onkeypress="return keyPress(event);" style="ime-mode:disabled" data-rule-required="true" data-rule-number="true"  maxlength="9" name="projectTypicalhouse_${index!}.amount"  value="${project.projectTypicalhouses[0].amount!}" >
	                                                <em>${_res["project.aud"]}</em>
	                                            </div>
	                                            <%}%>
	                                        </div>
	                                        <!-- 户型图 -->
	                                        <div class="faq_j">
		                                        <input type="file" style="opacity: 0;filter:alpha(opacity=0);-moz-opacity:0;-khtml-opacity: 0; " id="fileuploadfile${index!}" name="contenurl" onchange="fileUpload(this,'uploadfiles${index!}','${index!}');"/>
	                                            <a href="javascript:;" class="faq_jia" id="uploadfile${index!}" onclick="uploadImge(this);"></a>
	                                            <div class="faq_ji">
	                                                <div class="overE">
	                                                    <div id="uploadfiles${index!}">
		                                                	<%#ajax ajaxuploadfile:{
		                                                		if(!isEmpty(uploadFile!)){
		                                                	%>
		                                                	<input type="hidden" name="projectTypicalhouse_${index!}_${houseIndex!}.photo" value="${uploadFile.path!}">
		                                                    <%if(!isEmpty(uploadFile.path!)){%>
		                                                    <img src="${imgCxt!}/${uploadFile.path!}" alt="" width="125" height="125">
		                                                	<%}}}%>
		                                                </div>
	                                                    <span class="faq_ja_n">${_res["project.ApartmentLayout"]}</span>
	                                                    <a href="javascript:;" class="faq_ja faq_ja_m" onclick="deleteHouse(this);">${_res["project.delete"]}</a>
	                                                </div>
	                                            </div>
	                                        </div>
		                                 </div>
		                                 <%}}%>
	                               </div>
	
	                                <div class="clear"></div>
	                                <!-- 增加、移除多行 -->
	                                <a href="javascript:;" class="faq_ia faq_ia2 faq_ia02" onclick="addTypicalhouse();">${_res["project.add"]}</a>
	                                <!-- 增加、移除多行 -->
	                            </div>
	
	                            <input type="button" value="${_res['project.sale.next']}" class="kai_smn kai_step1_btn" onclick="validatepage1();"/>
	                        </div>
                    	</div>
                    </div>
            	</div>
            <!-- =========================================================== 第一步 结束 ================================================== -->
        </div>
	<!-- =========================================================== 第二步 开始 ================================================== -->
	<%include("/realty/project/kaifa_photo.html"){}%>
	<!-- =========================================================== 第二步 结束 ================================================== -->


	<!-- =========================================================== 第三步 开始 ================================================== -->
	<%include("/realty/project/kaifa_other.html"){}%>
	<!-- =========================================================== 第三步 结束 ================================================== -->
</form>
<#nav/> 
<#submit  formId="addProject"  divId="content" />
  <!--右边内容块-->
<!-- ========================================== foot ========================================== -->
<!-- ========================================== foot ========================================== -->
<!-- ======================================== content ======================================== -->
<script type="text/javascript">

$(document).ready(function() {
	
	searchCountry();
	
	//jq动态添加删除div
    //配套设施增加多行
	$(".faq_ia1").on('click',function () {
    	//根据主div下面的子div获取div的个数,从未获得参数序号
    	//@cqw start
       var num = $(".kai_sad1").children("div").length+2;
       var name="facilitieskey"+ num +"value"+ num+".itemValue";
       //end
       $(".kai_sad1").append("<div class='overE clear'><input type='text' class='kai_swm kai_swm1' name='" + name
       		+ "'><a href='javascript:;' onclick='removeFaqIA(this);' class='faq_ia3'>delete</a></div>");
    });
	
	$(".kai_step2_prev").click(function() {
		$(".kaifa_step2").hide();
		$(".kaifa_step1").show();
	})
	$(".kai_step3_prev").click(function() {
		$(".kaifa_step2").show();
		$(".kaifa_step3").hide();
	})
	if ($(".kai_sqq").length == 1) {
		$(".faq_ja:first").css("display", "none");
	} else {
		$(".faq_ja:first").removeCss("display");
	}
});

 	//创建楼盘只显示当前页：三个页面包含在同一个大的页面
	function page1(){
	     $(".kaifa_step2").hide();
	     $(".kaifa_step1").show();
	}
	
	//必输必填验证
	function validatepage1() {
		var $validate = $("#addProject").validate({
			ignore : ".page2",
		});
		if ($validate.form()) {
			$(".kaifa_step1").hide();
			$(".kaifa_step2").show();
		} else {
			var elements = document.forms[0].elements;
			for (i=0; i< elements.length;i++) {
			  $(elements[i]).removeClass("sign_input");
			};
			var errorList = $validate.errorList;
			for ( i = 0; errorList[ i ]; i++ ) {
				var error = errorList[ i ];
				var element = error.element;
				$(element).addClass("sign_input");
			};
		};
	};


	//必输必填验证
	function validateBasic() {
		var $validate = $("#addProject").validate({
			ignore : ".page1",
		});
		if ($validate.form()) {
			$(".kaifa_step2").hide();
			$(".kaifa_step3").show();
		} else {
			var elements = document.forms[0].elements;
			for (i=0; i< elements.length;i++) {
			  $(elements[i]).removeClass("sign_input");
			};
			var errorList = $validate.errorList;
			for ( i = 0; errorList[ i ]; i++ ) {
				var error = errorList[ i ];
				var element = error.element;
				$(element).addClass("sign_input");
			};
		};
	};

	$("#searchCountry").on('input onpropertychange', function() {
		searchCountry();
	});

	function selectDeveloper(obj) {
		//选择开发商
		$("#customerDeveloper").val($(obj).attr("title"));
		$("#developer").val($(obj).val());
	}
	
	function searchCountry() {
		var data = {
			toUrl : '/realty/project/kaifa.html#selectCountryAjax',
			name : $('#searchCountry').val()
		};
		ajaxDiv('countryUl', '/admin/project/listByName', data);
	};
	
	function clickCountryUI(document){
		$("#countryName").val($(document).text());
		$("#country").val($(document).val());
		$("#selectCountry").val($(document).text());
		$(".sign_two_sq").stop(true, true).slideUp();
	}

	

	//配套设施移除多行
	function removeFaqIA(document) {
		$(document).parent().remove();
	};

	//开发商 - 创建楼盘 - faq 增加多行
	function addFaq() {
		var num = $(".faq_ip").children("div").length + 2;
		$(".faq_ip")
				.append(
						"<div class='cyx_faq_add'>"
								+ "<input type='text'  style='margin: 10px 0px 10px 205px;width: 825px;' maxlength='80' name='faqvalue" + num + ".itemName' class='faq_ipp kai_swm1' placeholder='Q:'>"
								+ "<textarea class='faq_tea kai_swm1 floatE'  style='width:925px;padding: 5px 0px 5px 10px;' placeholder='A:' name='faqvalue"+num+".itemValue' maxlength='128'></textarea>"
								+ "<a href='javascript:;' onclick='removeFaqIA(this);' class='faq_ia3' style='padding: 0;    margin-left: 1036px;margin-top: -125px;'>delete</a></div>");
	}

	//国家下拉
	function countrySelect(document) {
		var _dd = $(".sign_two_sq");
		var _dt = $(".sign_two_ss input[type='text'].sign_two_sz");
		var _dtlength = _dt.length;
		var id = $(document).attr("id");
		if ($("#" + id + "Div").css("display") == "none") {
			_dt.removeClass("sign_two_ssh");
			_dd.stop().slideUp();
			$(this).addClass("sign_two_ssh");
			$("#" + id + "Div").stop().slideDown();
		} else {
			$(this).removeClass("sign_two_ssh");
			if (_dt.index(this) == _dtlength - 1) {
				$(this).addClass("sign_two_ssh");
			}
			$(this).removeClass("sign_two_ssh");
			$("#" + id + "Div").stop().slideUp();
		}
	};
	//添加户型
	function uploadImge(obj) {
		var id = $(obj).attr("id");
		$("#file" + id).click();
	};

	function fileUpload(obj, fileDivID, index) {
		var fileElementId = $(obj).attr("id");
		if (index == '') {
			index = 0;
		}
		var data = new Object();
		data.toUrl = "/realty/project/kaifa.html#ajaxuploadfile"; //行数
		data.index = index; //户型列
		data.houseIndex = $("#" + fileDivID).children(":hidden").size(); //图片Index
		ajaxMultiFileUpload(fileDivID, fileElementId, data);
	};

	// 图片上传
	function fileUpload1(obj, fileDivID, index) {
		var fileElementId = $(obj).attr("id");
		if (index == '') {
			index = 0;
		}
		var data = new Object();
		data.toUrl = "/realty/project/kaifa.html#ajaxuploadfile1"; // 行数
		data.index = index; // 户型列
		data.houseIndex = $("#" + fileDivID).children(":hidden").size();
		ajaxMultiFileUpload(fileDivID, fileElementId, data);
	};

	//默认第一个户型不可删除
	$(".faq_ja:first").css("display", "none");
	//添加一个户型 
	function addTypicalhouse(obj) {
		var data = new Object();
		data.toUrl = "/realty/project/kaifa.html#ajaxprojectTypicalhouse"; //行数
		data.index = $(".kai_sqq").size(); //行数	
		if (data.index == 1) {
			$(".faq_ja:first").css("display", "block");
		}
		ajaxAppendDiv("typicalhouseDivID", "/system/upload/ajaxUpload", data);
	};
	//删除的的时候判断是否是第一个
	function deleteHouse(document) {
		if ($(".kai_sqq").length == 1) {
			$(document).parent().parent().parent().parent().show();
		} else {
			$(document).parent().parent().parent().parent().remove();
		}
		var i = $(".kai_sqq").size();
		if (i == 1) {
			$(".faq_ja:first").css("display", "none");
		}
	};

	function ajaxAppendDiv(divId, url, data, callback) {
		$.ajax({
			type : "post",
			url : encodeURI(encodeURI(cxt + url)),
			data : data,
			dataType : "html",
			contentType : "application/x-www-form-urlencoded; charset=UTF-8",
			async : false,
			cache : false,
			success : function(returnData) {

				$("#" + divId).append(returnData);
				//扩展回调函数
				if (callback != null) {
					callback();
				}
			},
			error : function(XMLHttpRequest, textStatus, errorThrown) {
				alert("请求出现错误！");
			},
			complete : function(XMLHttpRequest, textStatus) {

			}
		});
	}

	// 经纬度限制只能输入"数字 - ."
	function keyPressCoordinates(e) {
		var currKey = e.keyCode || e.which || e.charCode;
		if ((currKey >= 48 && currKey <= 57) || currKey == 45 || currKey == 46
				|| currKey == 8 || currKey == 9) {
			return true;
		} else {
			return false;
		}
	}

	// 只能输入数字
	function keyPress(e) {
		// 获取按键码
		var currKey = e.keyCode || e.which || e.charCode;
		// 只允许输入数字,删除键 ,tab键
		if ((currKey >= 48 && currKey <= 57) || currKey == 8 || currKey == 9) {
			return true;
		} else {
			return false;
		}
	}
	
	$("#totalapartment").keyup(function(){
		var totalapartment = $(this).val();
		var available = $("#available").val();
		var sold = $("#sold").val();
		if(totalapartment==''){
			debugger;
			$("#sold").val("");
			$("#available").val("");
		}else{
			if(available>0){
				if(parseInt(totalapartment, 10)<parseInt(available, 10)){
					$("#available").val("0");
					sold = totalapartment;
				}else{
					sold = totalapartment-available;
				}
				$("#sold").val(sold);
			}
			if(sold>0){
				if(parseInt(totalapartment, 10)<parseInt(sold, 10)){
					$("#available").val("0");
					$("#sold").val("0");
					available = totalapartment;
				}else{
					available = totalapartment-sold;
				}
				$("#available").val(available);
			}
		}
		
		
	});
	
	//在售
	$("#available").keyup(function(){
		var available = $(this).val();
		var totalapartment = $("#totalapartment").val();
		var sold = $("#sold").val();
		if(totalapartment>0){
			//如果在售套数大于总套数，则将数字归0
			if(parseInt(totalapartment, 10)<parseInt(available, 10)){
				$(this).val("0");
				sold = totalapartment;
			}else{
				sold = totalapartment-available;
			}
			$("#sold").val(sold);
		}
	});
	
	//已售
	$("#sold").keyup(function(){
		var sold = $(this).val();
		var totalapartment = $("#totalapartment").val();
		var available = $("#available").val();
		if(totalapartment>0){
			//如果在售套数大于总套数，则将数字归0
			if(parseInt(totalapartment, 10)<parseInt(sold, 10)){
				$(this).val("0");
				available = totalapartment;
			}else{
				available = totalapartment-sold;
			}
			$("#available").val(available);
		}
		
	});
	
	//如果输入的时候输入框的值为0，则先清空
	$("#totalapartment").keydown(function(){
		if($(this).val()=="0"){
			$(this).val("");
		}
	});
	
	$("#available").keydown(function(){
		if($(this).val()=="0"){
			$(this).val("");
		}
	});
	
	$("#sold").keydown(function(){
		if($(this).val()=="0"){
			$(this).val("");
		}
	});
	
	//da
	if($("#da").val()=="0"){
		$("#dadate").attr("disabled","disabled");
		$("#dadate").val("");
	}else{
		$("#dadate").removeAttr("disabled");
	}
	
	$("#da").change(function(){
		if($(this).val()=="0"){
			$("#dadate").attr("disabled","disabled");
			$("#dadate").val("");
		}else{
			$("#dadate").removeAttr("disabled");
		}
	});
</script>

<script>
var start = {
    elem: '#start',
    format: 'YYYY/MM/DD hh:mm:ss',
    min: laydate.now(), //设定最小日期为当前日期
    max: '2099-06-16 23:59:59', //最大日期
    istime: true,
    istoday: false,
    choose: function(datas){
         end.min = datas; //开始日选好后，重置结束日的最小日期
         end.start = datas //将结束日的初始值设定为开始日
    }
};
var end = {
    elem: '#end',
    format: 'YYYY/MM/DD hh:mm:ss',
    min: laydate.now(),
    max: '2099-06-16 23:59:59',
    istime: true,
    istoday: false,
    choose: function(datas){
        start.max = datas; //结束日选好后，重置开始日的最大日期
    }
};
</script>

